﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Lant.Net.Model
{
	public class PukeCardCompare
	{
		/// <summary>
		/// 从大到小排列扑克牌
		/// </summary>
		/// <param name="X"></param>
		/// <param name="Y"></param>
		/// <returns></returns>
		public static int NumberDesc(PukeCard X, PukeCard Y)
		{
			if (X.Number != Y.Number)
				return Y.Number - X.Number;
			else
				return Y.Sign - X.Sign;
		}
		/// <summary>
		/// 从小到大排列扑克牌
		/// </summary>
		/// <param name="X"></param>
		/// <param name="Y"></param>
		/// <returns></returns>
		public static int NumberAsc(PukeCard X, PukeCard Y)
		{
			if (X.Number != Y.Number)
				return X.Number - Y.Number;
			else
				return X.Sign - Y.Sign;
		}
		/// <summary>
		/// 按照花色排序(降序)
		/// </summary>
		/// <param name="X"></param>
		/// <param name="Y"></param>
		/// <returns></returns>
		public static int SignDesc(PukeCard X, PukeCard Y)
		{
			if (X.Sign != Y.Sign)
				return X.Sign - Y.Sign;
			else
				return X.Number - Y.Number;
		}
		/// <summary>
		/// 按照花色排序(升序)
		/// </summary>
		/// <param name="X"></param>
		/// <param name="Y"></param>
		/// <returns></returns>
		public static int SignAsc(PukeCard X, PukeCard Y)
		{
			if (Y.Sign != X.Sign)
				return Y.Sign - X.Sign;
			else
				return Y.Number - X.Number;
		}
		
	}
}
